#ifndef __I2C_MASTER_H__
#define __I2C_MASTER_H__

#include <libopencm3/stm32/i2c.h>
/* use I2C1 I2C2 ... as function first parameter */

int i2c_master_init(int i2c);
int i2c_master_destroy(int i2c);
int i2c_master_trans(int i2c, unsigned char addr,
		     void *w, unsigned int wn, void *r, unsigned int rn);
int i2c_master_smbus_read_byte(int i2c, unsigned char addr, unsigned char cmd);
int i2c_master_smbus_write_byte(int i2c, unsigned char addr, unsigned char cmd,
				unsigned char data);


#endif
